/* $RCSFile: ADNDynTransactionCurrency.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/CRMWrapper3/DynEntities/ADNDynTransactionCurrency.cs $
 * $log$
 * Revision 19 2010/10/02 14:01:49  christian.surieux
 *   Corrected a bug in allmost everyADNDyn file for PrimaryFieldVualue
 * Revision 6 2010/08/06 19:56:33  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using CrmSdk;

namespace AddonNice.CRMWrapper
{
	public class ADNDynTransactionCurrency : DynEntity
	{
        protected class Ftor: DFactor
        {
            public Ftor() : base(CrmStr.transactioncurrency)
            {}

            public override Type DynType
            { get { return typeof(ADNDynTransactionCurrency); } }

            public override string DynTypename
            {   get{ return CrmStr.transactioncurrency;}}

            public override DynEntity Build()
            {   return new ADNDynTransactionCurrency();}

            public override DynEntity Build(CRMWrapperBase w, InternalDynamicEntity dEntity, PropertyDescriptorCollection wproperties)
            {   return new ADNDynTransactionCurrency(w, dEntity, wproperties, null);}

            public override DynEntity Build(CRMWrapperBase w, string PrimaryFieldValue)
            {   return new ADNDynTransactionCurrency(w, PrimaryFieldValue);}

            public override DynEntity Build(CRMWrapperBase w,Guid PrimaryKeyValue)
            {   return new ADNDynTransactionCurrency(w,PrimaryKeyValue);}
        }

        static ADNDynTransactionCurrency(){new Ftor();} 

        public override bool HasOwnerProperty
        {
            get{   return false;}
        }

        public override bool HasOwninguser
        {
            get{   return false;}
        }

        public override bool HasBusinessUnitProperty
        {
            get{   return false;}
        }

        public override bool HasOwningBusinessUnitProperty
        {
            get{   return false;}
        }

        public override bool OwningbusinessunitAsUniqueIdentifier
        {
            get{   return false;}
        }

        public ADNDynTransactionCurrency(): base()
		{}

        public ADNDynTransactionCurrency(CRMWrapperBase w, string PrimaryFiedlValue)
			: base(w,CrmStr.transactioncurrency)
		{
            if ( PrimaryFiedlValue != string.Empty )
                currencyname    =   PrimaryFiedlValue;
		}

		public ADNDynTransactionCurrency(CRMWrapperBase w, Guid CrmId)
			: base(w,CrmStr.transactioncurrency, CrmId)
		{}

		public ADNDynTransactionCurrency(CRMWrapperBase w, InternalDynamicEntity e)
			: base(w,CrmStr.transactioncurrency,e,null,null)
		{}

		public ADNDynTransactionCurrency(CRMWrapperBase w, InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s)
			: base(w,CrmStr.transactioncurrency,e,prop,s)
		{}

        public ADNDynTransactionCurrency(ResetWrapperHandler fn, string PrimaryFiedlValue)
			: base(fn,CrmStr.transactioncurrency)
		{
            if ( PrimaryFiedlValue != string.Empty )
                currencyname    =   PrimaryFiedlValue;
		}

		public ADNDynTransactionCurrency(ResetWrapperHandler fn, Guid CrmId)
			: base(fn,CrmStr.transactioncurrency, CrmId)
		{}

		public ADNDynTransactionCurrency(ResetWrapperHandler fn, InternalDynamicEntity e)
			: base(fn,CrmStr.transactioncurrency,e,null,null)
		{}

		public ADNDynTransactionCurrency(ResetWrapperHandler fn, InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s)
			: base(fn,CrmStr.transactioncurrency,e,prop,s)
		{}

        /// <summary>
		/// Crm Key
		/// </summary>
        [CrmDynAttribute(CrmStr.transactioncurrency)]
        public Guid transactioncurrencyid
		{
			get
			{
				return KeyPropertyValue(CrmStr.transactioncurrencyid);
			}
			set
			{
				AddKeyProperty(CrmStr.transactioncurrencyid, value);
			}
		}

        protected override void SetCrmIdProperty(Guid crmId)
        {
           if ( !dicProperty.ContainsKey(CrmStr.transactioncurrencyid) || KeyPropertyValue(CrmStr.transactioncurrencyid) != crmId )
                transactioncurrencyid   =   crmId;
        }
        
        public override string PrimaryFieldName
        {
            get
            {
               return CrmStr.currencyname;
            }
           set
           {}
        }

        /// <summary>
        /// Value contained in the PrimaryField for the DynEntity or empty if no PrimaryField
        /// </summary>
        public override string PrimaryFieldStringValue
        {
            get
            {
                return currencyname;
            }
            set
            {
                currencyname =   value;
            }
        }

        public override Guid PrimaryKeyGuidValue
        {
           get
           {
                return transactioncurrencyid;
           }
           set
           {
               transactioncurrencyid    =   value;
           }
        }

        [CrmDynAttribute(CrmStr.transactioncurrency)]
        public string currencyname 
        {
            get
            {
                return StringPropertyValue(CrmStr.currencyname);
            }
            set
            {
                AddStringProperty(CrmStr.currencyname,value);
            }
        }

        [CrmDynAttribute(CrmStr.transactioncurrency)]
        public string currencysymbol 
        {
            get
            {
                return StringPropertyValue(CrmStr.currencysymbol);
            }
            set
            {
                AddStringProperty(CrmStr.currencysymbol,value);
            }
        }

        [CrmDynAttribute(CrmStr.transactioncurrency)]
        public string isocurrencycode 
        {
            get
            {
                return StringPropertyValue(CrmStr.isocurrencycode);
            }
            set
            {
                AddStringProperty(CrmStr.isocurrencycode,value);
            }
        }
        
        [CrmDynAttribute(CrmStr.transactioncurrency)]
        public decimal exchangerate
        {
            get
            {
                return DecimalPropertyValue(CrmStr.exchangerate);
            }
            set
            {
                AddDecimalProperty(CrmStr.exchangerate,value);
            }
        }
   }
}